<script setup lang="ts">
import { RouterView } from 'vue-router'
import HeaderMain from './components/HeaderMain.vue'
import { ref, watch } from 'vue'
import router from './router'
import { login } from './api/home'
const currentRoute = ref('')
watch(
  () => router.currentRoute.value,
  async (toPath) => {
    currentRoute.value = toPath.path
    await login({
      Acctid: '6541b8b552fbe4',
      userName: '18720544598',
      password: '666666',
      lcid: 2052
    })
  },
  { immediate: true, deep: true }
)
</script>

<template>
  <header v-if="currentRoute !== '/login'">
    <HeaderMain />
  </header>
  <RouterView />
</template>

<style scoped></style>
